*{
Waiting for other views to call it

this template will be passed 'model' and 'as'  parameter, where 
model can be a Plan/Request/Idea Object
as is the controller that has the modules show method

ex: #{share model:idea, as:'Idea' /}

author Amr Draz

}*

<h3>Share with a friend</h3>

#{form @Application.share()}

	#{ifErrors}
		<p class="error">
			${errors[0]}
		</p>
	#{/ifErrors}

    <p>
        <label for="sender">Your name: </label>
        <input type="text" name="sender" id="sender" />
    </p>
    <p>
        <label for="emailTo">send to: </label>
        <input type="text" name="emailTo" id="emailTo" />
    </p>
    <p>
		<label for="content">Your message: </label>
		<textarea name="content" id="content">Hey, check this out</textarea>
	</p>
	%{ 
		if(_as.equals("idea")) {
			loginPath = '@{Ideas.show(model.id))}'
		} else if (_as.equals("plan")) {
			loginPath = '@{Plans.show(model.id))}'
		} else {
			loginPath = '@{Requests.show(model.id))}'
		}
		
	}%
	
	<input type="hidden" name="path" value="${loginPath}" />
	<p>
		<input type="submit" value="share" />
	</p>
	
#{/form}